<template>
	<!-- 标题 -->
	<h4 class="text-center">商品管理</h4>
	<!-- 用户列表 -->
	<table border style="width: 100%">
		<thead>
			<tr>
				<th>编号</th>
				<th>商品</th>
				<th>数量</th>
				<th>单价</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<tr v-for="item in goodlist" :key="item.id">
				<td>{{ item.id }}</td>
				<td>{{ item.name }}</td>
				<td>{{ item.num }}</td>
				<td>{{ item.price }}</td>
				<td>
					<router-link :to="'/home/goods/' + item.id">详情</router-link>
				</td>
			</tr>
		</tbody>
	</table>
</template>

<script setup>
	const goodlist = [
		{ id: '1', name: '苹果', num: '10' ,price:'1'},
		{ id: '2', name: '香蕉', num: '20' ,price:'2'},
		{ id: '3', name: '榴莲', num: '30' ,price:'3'},
		{ id: '4', name: '菠萝', num: '40' ,price:'4'},
	]
</script>